   // 获取所有活动卡片和悬浮窗元素
        const postItems = document.querySelectorAll('.post-item');
        const modals = document.querySelectorAll('.modal');
        const closeBtns = document.querySelectorAll('.close-btn');

        // 点击活动卡片，显示对应悬浮窗
        postItems.forEach(item => {
            item.addEventListener('click', () => {
                const targetModalId = item.getAttribute('data-modal-target');
                const targetModal = document.getElementById(targetModalId);
                if (targetModal) {
                    targetModal.classList.add('show');
                    // 禁止背景滚动
                    document.body.style.overflow = 'hidden';
                }
            });
        });

        // 点击关闭按钮，隐藏悬浮窗
        closeBtns.forEach(btn => {
            btn.addEventListener('click', () => {
                const modal = btn.closest('.modal');
                modal.classList.remove('show');
                // 恢复背景滚动
                document.body.style.overflow = 'auto';
            });
        });

        // 点击悬浮窗遮罩层，隐藏悬浮窗
        modals.forEach(modal => {
            modal.addEventListener('click', (e) => {
                if (e.target === modal) {
                    modal.classList.remove('show');
                    document.body.style.overflow = 'auto';
                }
            });
        });
